/*
 * ExtentSumStatistics.cpp
 *
 *  Created on: Dec 18, 2011
 *      Author: Gal
 */

#include <iostream>
#include <stdlib.h>

#include "ExtentSumStatistics.h"

ExtentSumStatistics::ExtentSumStatistics(LUNID id, int offset, double lunPrio, ExtentStatistics* stats) {
	my_extent = new Extent(id, offset, lunPrio);
	my_stats = new ExtentStatistics();
	for (int i=0; i<11;i++)
		my_stats->statistics[i]=stats->statistics[i];
}

ExtentSumStatistics::ExtentSumStatistics(const ExtentSumStatistics* e){
	my_extent = new Extent(e->my_extent->my_lunID, e->my_extent->my_offset, e->my_extent->lunPriority);
	my_stats = e->my_stats;
}

bool ExtentSumStatistics::operator< (const ExtentSumStatistics &b) const{
	//cout<<"<"<<endl;
	// returns true if this extent was more active (random read miss) than b
	if (my_stats->statistics[rand_rm] > b.my_stats->statistics[rand_rm])
		return true;
	else
		return false;
}

//bool ExtentSumStatistics::operator== (const ExtentSumStatistics &b) const{
	//return (my_extent->operatorEqual (*b.my_extent));
//}

//bool ExtentSumStatistics::operatorEqual (const ExtentSumStatistics &b) const{
	//return (my_extent->operatorEqual(*b.my_extent));
//}




